
x,y=input("鸡兔共x只 一共数到y条腿").split()
x=int(x)
y=int(y)

for a in range(x+1):
   if 2*a+4*(x-a)==y:
      b=x-a
      print(a," ",b)

